/*
 * Copyright (c) novafaen design 2009
 */
package tentaflykt.util;

import tentaflykt.gui.AbstractWindow;

/**
 * Tentaflykt GUI utilities. This class should be used as
 * with static behavior to control the main window functions.
 * <br><br>
 * This requires that the main window is initiated with
 * <code>setMainFrame(AbstractWindow)</code> function, preferably
 * in the Exec<i>&lt;Functionality&gt;</i> class.
 * <br><br>
 * Development notice, this does not throw exceptions if
 * initiated incorrectly, so make sure that the main <code>AbstractWindow</code>
 * is set before using any other functions.
 * @author Kristoffer Nilsson
 */
public class GUIUtil {
  private static AbstractWindow window;
  
  /**
   * Set Main window, should be called from Exec<i>CLASS</i> classes.
   * @param frame The main window
   */
  public static void setMainFrame(AbstractWindow frame) {
    window = frame;
  }
  
  /**
   * @return The main window
   */
  public static AbstractWindow getMainFrame() {
    // should this throw an exception?
    return window;
  }
}
